package com.xunfang.application;

import com.xunfang.bean.Person;
import com.xunfang.bean.User;
import com.xunfang.controller.UserController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author yellow Docter
 * @date 2023 -10-10
 * @desc
 *     通过注解 给 对象 进行 注入
 */
public class App02 {

    public static void main(String[] args) {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application.xml");
        User user = applicationContext.getBean("user", User.class);
        System.out.println("user = " + user);

        Person person = applicationContext.getBean("person", Person.class);
        System.out.println("person = " + person);

    }

}
